# ------面向对象设计-----------
def dog(name,gender,type):
    def jiao(dog):
        print ('一只狗%s 在叫' % dog["name"])
    def kanjia(dog):
        print ('一只狗%s 在看家' % dog["type"])
    def init(name,gender,type):
        dog={"name":name,
              'gender':gender,
              "type":type,
              "kanjia":kanjia,
              'jiao':jiao,
             }
        return dog
    res = init(name,gender,type)
    return res
d1=dog('旺财','公','藏獒')
d2=dog('大黄','母','哈撒奇')
print(d1)
d1['jiao'](d1)
d2['kanjia'](d2)